import java.util.ArrayList;
import java.util.Random;


public class Cat {
	
	//variables
	
	String name;
	String color;
	int age;
	int length;
	Boolean isAlive;
	
	//constructors
		public Cat() {
			this.name="Jack";
			this.color="Black";
			this.age=2;
			this.length = 5;
			this.isAlive=true;
		}
		
		public Cat(String name) {
			this.name=name;
			this.color="Black";
			this.age=2;
			this.length=5;
			this.isAlive=true;
			
		}
	
	//methods
		//scope-modifier return type(name-parameter type-parameter name)
		public String toString() {
			
			
			String temp = "";
			
			temp += name;
			temp += " ";
			temp += color;
			temp += " ";
			temp += age;
			temp += " ";
			temp += isAlive;
			temp += " ";
			temp += length;
			
			return temp;
			
		}
		
		public int age() {
			age++;
			length++;
			return age;
		}
		
		boolean hitwithTruck() {
			length*=2;
			isAlive = false;
			return isAlive;
		}
		
		public ArrayList<Cat> havebabies() {
			Random gen = new Random();
			int babynum = gen.nextInt()%20;
			ArrayList<Cat> temp = new ArrayList<Cat>();
			
			for(int i=0;i<babynum;i++) {
				temp.add(new Cat());
			}
			return temp;
		
		}
		
		

}
